//
//  WmcTextTagView.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/16.
//

import UIKit

class WmcTextBackgroundTagView: WmcBaseTagView {

    
    override func makeUI() {
        super.makeUI()
        tagStyle = .textBackground
        defaultSize = CGSize(width: 255, height: 110)
        
        contentView.layer.cornerRadius = 4
        contentView.layer.masksToBounds = true
        
        contentView.addSubview(textLabel)
        textLabel.snp.makeConstraints { make in
            make.top.equalTo(12)
            make.left.equalTo(14)
            make.bottom.equalTo(-12)
            make.right.equalTo(-14)
        }
    }
    override func changeColor(_ color: WmcBaseTagView.Colors) {
        let uicolor = color.info.hexStr.yp.uiColor
        if color == .white {
            textLabel.textColor = .wmc_grayH2_323233
        }else{
            textLabel.textColor = .white
        }
        let alphaColor = uicolor.yp.alpha(0.7)
        contentView.backgroundColor = alphaColor
    }
}
